public class Pet
{
    private String name;
    private int age;
    private String race;
    private String ageString;
    public Pet(String name) {
        this.name = name;
        int ran1=(int)(Math.random()*100+1);
        this.age=ran1;
        int ran2=(int)(Math.random()*100);
        int ran3=(int)Math.random()*100;
        if(ran1<=10)
            this.ageString="羽毛未丰";
        else if(ran1<=20)
        {
            if(ran3<=50)
                this.ageString="年富力强";
            else
                this.ageString="少不更事";
        }
        else if(ran1<=40)
        {
            if(ran3<=50)
                this.ageString="未老先衰";
            else
                this.ageString="普普通通";
        }
        else if(ran1<=60)
        {
            if(ran3<=50)
                this.ageString="年高德劭";
            else
                this.ageString="不擒二毛";
        }
        else if(ran1<=80)
        {
            if(ran3<=50)
                this.ageString="年登花甲";
            else
                this.ageString="老当益壮";
        }
        else
        {
            if(ran3<=50)
                this.ageString="年衰岁暮";
            else
                this.ageString="老大无成";
        }
        if(ran2<=20)
        {
            this.race="加拉克苏斯大王";
        }
        else if(ran2<=40)
        {
            this.race="玛瑟里顿";
        }
        else if(ran2<=60)
        {
            this.race="虚空行者";
        }
        else if(ran2<=80)
        {
            this.race="末日守卫";
        }
        else if(ran2<=100)
        {
            this.race="阿兰纳斯蛛后";
        }
    }
    public void showPet()
    {
        System.out.println("您有一只"+this.ageString+"的"+this.race);
        System.out.println("昵称:"+this.name);
        System.out.println("年龄:"+this.age);
    }
    public void effect(Player player)
    {
        if(this.race=="阿兰纳斯蛛后")
        {
            player.changestrenghExpend(-1);
            System.out.println("召唤出"+this.race+"能使你的体力值消耗减少一点");
        }
        else if(this.race=="末日守卫")
        {
            player.changeATK(3);
            player.changeDEF(-1);
            System.out.println("召唤出"+this.race+"增加3点攻击力，但是减少1点防御力");
        }
        else if(this.race=="虚空行者")
        {
            player.changeDEF(3);
            player.changeATK(-1);
            System.out.println("召唤出"+this.race+"增加3点防御力，但是减少1点攻击力");
        }
        else if(this.race=="加拉克苏斯大王")
        {
            player.changeStrength(30);
            System.out.println("召唤出"+this.race+"直接增加30点体力值");
        }
        else if(this.race=="玛瑟里顿")
        {
            player.changeDEF(1);
            player.changeStrength(1);
            player.changestrenghExpend(1);
            player.changeATK(1);
            System.out.println("召唤出"+this.race+"强大的恶魔能极大的提升实力,全属性加1（包括行动消耗）");
        }
    }
    public int getAge() {
        return this.age;
    }
    
    public String getName() {
        return this.name;
    }
    public String getRace() {
        return this.race;
    }
}